package com.atguigu.service.impl;

import com.atguigu.dao.UserDao;
import com.atguigu.pojo.User;
import com.atguigu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Jia Fa
 * @create 2021-10-09 0:25
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserDao userDao;

    @Override
    public Object deleteById(Integer id) {
        return userDao.deleteByPrimaryKey(id);
    }

    @Override
    public Object edit(User user) {
        return userDao.updateByPrimaryKeySelective(user);
    }

    @Override
    public Object add(User user) {
        return userDao.insertSelective(user);
    }

    @Override
    public Object findAll() {
        return userDao.selectAll();
    }
}
